package com.atguigu.serviceedu.controller.site;

import com.atguigu.serviceedu.entity.vo.EduSubjectVO;
import com.atguigu.serviceedu.service.EduSubjectService;
import com.atguigu.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/site/subject")
public class SiteSubjectController {
    @Autowired
    private EduSubjectService eduSubjectService;
    @GetMapping("/getNestedSubjectListByParentIdForSite/{id}")
    public ResultVO getNestedSubjectListByParentIdForSite(@PathVariable("id") String id){
        List<EduSubjectVO> subjectVOList = eduSubjectService.queryNestedListByParentIdForSite(id);
        return ResultVO.ok().Msg("获取课程父子类别成功").Data("subjectVOList",subjectVOList);
    }
}
